#pragma once

#include <grpc++/grpc++.h>
#include "keyValue.hpp"

namespace etcdv3 {
    
class V3Response {
public:
    V3Response(): error_code(0), index(0) {};
    void set_error_code(int code);
    int get_error_code() const;
    std::string const& get_error_message() const;
    void set_error_message(std::string msg);
    void set_action(std::string action);
    int64_t get_index() const;
    std::string const& get_action() const;
    std::vector<KeyValue> const& get_values() const;
    std::vector<KeyValue> const& get_prev_values() const;
    KeyValue const& get_value() const;
    KeyValue const& get_prev_value() const;
    bool has_values() const;
protected:
    int error_code;
    int64_t index;
    std::string error_message;
    std::string action;
    KeyValue value;
    KeyValue prev_value;
    std::vector<KeyValue> values;
    std::vector<KeyValue> prev_values;
};

}
